www.gusucode.com > Matlab动力系统和时间序列分析工具箱 > Matlab动力系统和时间序列分析工具箱/lab432/toolbox/global reconstruction/disp_result_gr_model.m

    function disp_result_gr_model(gr);
% Display global reconstruction model.

% last modified 10.02.05

old_format=get(0,'Format');
format short;
Coeffs=gr.coeffs;
txt=[gr.left_part '='];
for i=1:length(Coeffs)
        txt=[txt sprintf('%+.6f',Coeffs(i)) '*' kill_points(gr.funcs_txt{i})];
end
disp('________________________________________________________________');
disp('Model type (global reconstruction):');
try
    e=sym(gr.gm);   % recuire Symb. Toolbox
    pretty(e,80);
catch
     disp(gr.gm);
end
disp('Result model:');
try
    e=sym(txt);   % recuire Symb. Toolbox
    pretty(e,80);
catch
     disp(txt);
end

disp('Here: ')
for i=1:length(gr.x.name)
    STR=['      ' 'x' num2str(i) ' is ' gr.x.name{i}];
    disp(STR)
end

str=sprintf('\nError variance: %f \nNormalized error variance: %.3f  (%.2f %%)',var(gr.err),var(gr.err)/var(gr.B),var(gr.err)/var(gr.B)*100);
disp(str);
format(old_format);




function s=kill_points(str);
s=[];
for i=1:length(str)
    if (str(i)=='.')
        if isempty(str2num(str(i-1)))|isempty(str2num(str(i+1)))
            continue
        end
    end
    s=[s str(i)];
end